package com.bfsuol.bfsuolframework.security.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface RolePrivilegeMapper extends BaseMapper<RolePrivilege> {

    @Delete("delete from t_sec_role_privilege where role_id=#{roleid}")
    void delByRole(Long roleid);

    @Select("select * from t_sec_role_privilege rp where rp.role_id=#{roleid} and rp.privilege_code=#{pcode}")
    RolePrivilege findByRolePri(Long roleid, String pcode);
}
